<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			let that = this;
			wx.login({
				success:(res) => {
					that.$u.api.getUser({code:res.code}).then(res =>{
						that.$u.vuex('vuex_user', res.data)
						
						if(!res.data.model){
							that.$u.route({
								url: 'pages/model/model',
								params: {
									blak: 0
								}
							})
						}
					})
				},
				fail: () => {
					wx.showToast({
						title:'登录失败',
						icon:'none'
					})
				}
			})
			
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
</style>
<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	@import "uview-ui/index.scss";
	@import "common/demo.scss";
</style>